fix: Fix airplane mode tips display logic#489
fix: Fix airplane mode tips display logic#489deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
Conversation
Fix the logic for displaying airplane mode tips by adding wireless support check. Only show the tips when airplane mode is enabled AND wireless is supported. Log: Fixed airplane mode tips display condition PMS: BUG-349721 fix: 修复飞行模式提示显示逻辑 修复飞行模式提示的显示逻辑,增加无线支持检查。仅在飞行模式启用且支持无线功能时显示提示。 Log: 修复飞行模式提示显示条件 PMS: BUG-349721
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRefines airplane mode tip visibility logic to depend on both airplane mode state and actual wireless hardware support, by introducing a reusable wireless-support check and reusing it from existing airplane mode support logic. Sequence diagram for airplane mode tips visibility updatesequenceDiagram
actor User
participant NetManager
participant NetManagerPrivate
participant NetManagerThreadPrivate
participant NetworkManager
participant UI
User->>NetManager: toggleAirplaneMode(bool enabled)
NetManager->>NetManagerPrivate: updateAirplaneMode(bool enabled)
NetManagerPrivate->>NetManagerPrivate: set m_airplaneMode
NetManagerPrivate->>NetManager: airplaneModeChanged(m_airplaneMode)
NetManagerPrivate->>NetManagerThreadPrivate: supportWireless()
NetManagerThreadPrivate->>NetworkManager: networkInterfaces()
NetworkManager-->>NetManagerThreadPrivate: NetworkManagerDeviceList
loop check_wifi_devices
NetManagerThreadPrivate->>NetManagerThreadPrivate: find managed wifi device
end
NetManagerThreadPrivate-->>NetManagerPrivate: bool wirelessSupported
NetManagerPrivate->>UI: updateItemVisible(NetAirplaneModeTipsItem, enabled && wirelessSupported)
NetManagerPrivate->>UI: updateItemVisible(NetWirelessDisabledItem, false) [if enabled]
NetManagerPrivate->>UI: updateItemVisible(NetWiredDisabledItem, false) [if enabled]
Class diagram for updated airplane mode and wireless support logicclassDiagram
class NetManagerThreadPrivate {
- bool m_airplaneModeEnabled
+ bool AirplaneModeEnabled() const
+ bool supportWireless() const
+ bool supportAirplaneMode() const
}
class NetManagerPrivate {
- bool m_airplaneMode
- NetManagerThreadPrivate* m_managerThread
+ void updateAirplaneMode(bool enabled)
}
NetManagerPrivate --> NetManagerThreadPrivate : uses
NetManagerThreadPrivate ..> NetworkManager : queries
NetManagerThreadPrivate ..> NetworkManagerDevice : iterates_wifi_devices
class NetworkManager {
+ static NetworkManagerDeviceList networkInterfaces()
}
class NetworkManagerDevice {
+ int type()
+ bool managed()
}
class NetworkManagerDeviceList {
}
NetworkManagerDeviceList "*" --> NetworkManagerDevice
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: caixr23, ut003640 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/merge |
|
This pr cannot be merged! (status: unstable) |
|
/forcemerge |
|
This pr force merged! (status: unstable) |
| Q_EMIT q->airplaneModeChanged(m_airplaneMode); | ||
| } | ||
| updateItemVisible("NetAirplaneModeTipsItem", enabled); | ||
| updateItemVisible("NetAirplaneModeTipsItem", enabled && m_managerThread->supportWireless()); |
There was a problem hiding this comment.
netmanager.cpp在主线程中,m_managerThread在子线程中,不要直接调用。
使用缓存,有变化时信号更新
Fix the logic for displaying airplane mode tips by adding wireless support check. Only show the tips when airplane mode is enabled AND wireless is supported.
Log: Fixed airplane mode tips display condition
PMS: BUG-349721
fix: 修复飞行模式提示显示逻辑
修复飞行模式提示的显示逻辑,增加无线支持检查。仅在飞行模式启用且支持无线功能时显示提示。
Log: 修复飞行模式提示显示条件
PMS: BUG-349721
Summary by Sourcery
Adjust airplane mode handling to consider wireless support when determining tips visibility and capability checks.
Bug Fixes:
Enhancements: